<div id="NavMain" class="Line">
    <?php
    form_pr('ClientOptions', '', '', 'post');
    mn_field('hidden', 'ED', 'CliNumero', $_GET['OB'], '', '', '', '');
    mn_field('hidden', 'ED', 'OBJCTCL', $_GET['OB'], '', '', '', '');

    mn_field('button', 'ED', 'CliInquire', 'Campanha Canta', '10', '30', 'True', 'SUBMIT" onclick="
		modalwindow(\'Inquerito\',\'Modules/CMX3458E/mquiz4.php?nb_cliente=' . $_GET['OB'] . '\',800,400);" style="width:170px');

    mn_field('button', 'ED', 'CliOpen', 'Ficha de Cliente', '10', '30', 'True', 'SUBMIT"
		onclick="document.ClientOptions.action=\'_response/call.php?get=Operative/view/viewsender\';
		subform(\'ClientOptions\',\'contents\');" style="width:170px');
    if ($_GET['CST'] == 0) {
        mn_field('button', 'ED', 'CliBlock', 'Bloquear Cliente', '10', '30', 'True', 'SUBMIT"
		onclick="modalwindow(\'Bloqueio de Cliente\',\'_response/call.php?get=Operative/view/senderblock&CID=' . $_GET['OB'] . '&CST=' . $_GET['CST'] . '\',300,150);" style="width:170px');
    } elseif ($_GET['CST'] == 1) {
        $GETLK = $GLOBALS['MYT']->db_array("SELECT lbk_Nivel,blk_Informacion FROM hd_bloqueos WHERE blk_Codigo = {$_GET['OB']} ORDER BY blk_ID DESC LIMIT 0,1");
        if (isset($GETLK[1]['lbk_Nivel']) && $GETLK[1]['lbk_Nivel'] > 1) {
            echo '<div class="Alert">Bloqueado pelo Backoffice</div>';
        } else {
            if (isset($GETLK[1]['lbk_Nivel'])) {
                echo '<div class="Alert">' . $GETLK[1]['blk_Informacion'] . '</div>';
            }
            mn_field('button', 'ED', 'CliUnblock', 'Desbloquear Cliente', '10', '30', 'True', 'SUBMIT"
		onclick="modalwindow(\'Bloqueio de Cliente\',\'_response/call.php?get=Operative/view/senderblock&CID=' . $_GET['OB'] . '&CST=' . $_GET['CST'] . '\',300,150);" style="width:170px');
        }
    } elseif ($_GET['CST'] == 2) {
        echo '<div class="Alert">Bloqueado por dados desactualizados.</div>';
    }
    mn_field('button', 'ED', 'CliUpdate', 'Actualizar dados', '10', '30', '', 'SUBMIT" style="width:170px" onclick="
		var properties = new Ext.Window({
		title:\'Actualizacao de dados de Cliente\',
		autoLoad: \'_response/call.php?get=Operative/view/viewsenderupdate&SenderID=' . $_GET['OB'] . '&VField1=1&VField2=1\',
		modal:false,
		id:\'winclupdate\',
		width:500,
		height:400,
		closable:true,
		resizable:false
		});
		properties.show();');
    mn_field('button', 'ED', 'CliHistory', 'Histórico', '10', '30', 'True', 'SUBMIT" style="width:170px" onclick="
		document.ClientOptions.action=\'_response/call.php?get=Operative/view/viewclienthistory\';
		subform(\'ClientOptions\',\'Hist_Show\');');
    mn_field('button', 'ED', 'CliExtract', 'Extracto de Conta', '10', '30', 'True', 'SUBMIT" style="width:170px" onclick="
		document.ClientOptions.action=\'_response/call.php?get=Operative/client_balance\';
		subform(\'ClientOptions\',\'contents\');');
    ?>
</form>
</div>
<div class="Line"><b>Envios</b> | <a href="">Remessa</a> | <a href="">Data</a></div>
<div id="SndOrdersList" style="overflow:auto;width:176px;margin:1px;">
    <table width="160"  border="0" cellspacing="1" cellpadding="1">
        <?php
        $s_a = array(1, 9, 10);
        $s_b = array(2, 7);
        $prtlist = '';
        $GET = $GLOBALS['MYT']->db_array("SELECT DATE_FORMAT(FraFechaIngreso, '%d/%m/%y') AS Time, CorrAgente, FraID, FraStatus, FraEnviado
		FROM facturas
		INNER JOIN corresponsales ON FraCorresponsal = CorrNumero
		WHERE FraCliNumero = {$_GET['OB']} ORDER BY FraID DESC");
        for ($u = 1; $u <= $GET[0]; $u++) {
            if (in_array($GET[$u]['FraStatus'], $s_a)) {
                $stimg = 'gfx0094.png';
            } elseif (in_array($GET[$u]['FraStatus'], $s_b)) {
                $stimg = 'true.png';
            } else {
                $stimg = 'alert.png';
            }
            $prtlist .= '<tr bgcolor="';
            if ($GET[$u]['FraStatus'] == 10) {
                $prtlist .= '#FFCC99';
            } else {
                $prtlist .= gridlines($u);
            } $prtlist .= '">
      <td>';
            if ($GET[$u]['FraStatus'] != 10) {
                $prtlist .= '<a href="javascript:modalwindow(\'Detalhes\',\'_response/call.php?get=Operative/frm_transferdetails&RSID=' . $GET[$u]['FraID'] . '\',680,500);">' . $GET[$u]['Time'] . '</a> ' . $GET[$u]['CorrAgente'];
            } else {
                $prtlist .= $GET[$u]['Time'];
            }
            $prtlist .= '</td>
      <td align="right">' . number_format($GET[$u]['FraEnviado'], 2, ',', '') . '</td>
	  <td>';
            if ($GET[$u]['FraStatus'] != 10) {
                $prtlist .= '<img height="15" src="_response/bin.php?get=default/' . $stimg . '" />';
            } $prtlist .= '</td>
    </tr>';
        }
        if ($_GET['ARC'] == 1) {

            $prtlist .= '<tr><td colspan="2" height="20px" bgcolor="#CCCCCC" onclick="replaceUrl(\'RemittanceArchive\',\'_response/call.php?get=Operative/RemittanceArchive&ClientID=' . $_GET['OB'] . '\');">
                    <b>Remessas Arquivadas</b></td>
                    <td><img height="15" src="_response/bin.php?get=default/alert.png" /></td></tr>';
        }
        echo $prtlist;
        ?>
    </table>
    <div id="RemittanceArchive"></div>
</div>
<script charset="utf-8" type="text/javascript">
    document.getElementById('SndOrdersList').style.height=(document.documentElement.clientHeight-310)+'px';</script>
<div id="NavContents" class="Line">
</div>